<?php

require_once('db_connection.php');

pr($_FILES);

/////////// UPLOAD IMAGES //////
  $file_name = $_FILES['image']['name'];
  $src = $_FILES['image']['tmp_name'];
  $dest = "p_images/$file_name";
  move_uploaded_file($src,$dest);
  $_POST['image'] = $file_name;
////////////////////////////////
exit;
if(isset($_POST['name'])) {

  $_POST['added_date'] = date('Y-m-d H:i:s');
  $_POST['status'] = '1';
  pr($_POST);
   /******* start query  *********/
    $id = insert('products',$_POST);
    pr($id);
    if($id){
      header('location:show_all_products.php');
      exit;
    }
    /******* end query  *********/
}
?>
